package com.gtl.meishi.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.gtl.meishi.fragment.HotFragment1;

import java.util.List;

/**
 * Created by zhangke on 16/7/9.
 */
public class HotFragmentAdapter extends FragmentPagerAdapter {
    //private List<HotFragment> listFragments;
    private List<HotFragment1> listFragments;
    public HotFragmentAdapter(FragmentManager fm, List<HotFragment1> listFragments) {
        super(fm);
        this.listFragments=listFragments;
    }

    @Override
    public Fragment getItem(int position) {
        return listFragments==null?null:listFragments.get(position);
    }

    @Override
    public int getCount() {
        return  listFragments==null?0: listFragments.size();

    }

    @Override
    public CharSequence getPageTitle(int position) {
        return listFragments.get(position).getCotegroyEntity().getName();

    }
}
